return function(var, lib, t, i)
	local x_pos = var.x_pos
	local y_pos = var.y_pos
	local max_width = var.max_width
	local max_height = var.max_height

	local padding = t[i].padding or 0
	local radius = t[i].radius or 0

	if t[i].button_down == nil then t[i].button_down = false end

	--[[
	local touches = love.touch.getTouches()
	for i, id in ipairs(touches) do
			local x, y = love.touch.getPosition(id)
			mx = x
			my = y
			break
		end
	--]]


	if mx > x_pos+padding and mx < x_pos+max_width-padding and my > y_pos+padding and my < max_height+y_pos-padding and ((mx+x_pos >= 0 and my+y_pos >= 0 and mx-x_pos <= max_width and my-y_pos <= max_height)) then--or (my+y_pos+max_height >= 0))then
		local r, g, b = love.graphics.getColor()
		love.graphics.setColor(r+0.2,g+0.2,b+0.2)

		--if t[i].func ~= nil then
			if love.system.getOS() == 'Android' then		
				if t[i].button_down == false and (mx >= 0 and my >= 0) then t[i].button_down = true

				end
			else
				if t[i].button_down == false and love.mouse.isDown(1) then
					t[i].button_down = true
				end
			end
		--end

		--[[
		if love.system.getOS() == 'Android' then
			local touches = love.touch.getTouches()
		
			for i, id in ipairs(touches) do
				local x, y = love.touch.getPosition(id)
				mx = x
				my = y
			end
		end
		--]]

		--[[
		if love.mouse.isDown(1) and t[i].func ~= nil and button_down == false then
			t[i].func(t[i])
		end
		--]]

	else
		
	end

	if t[i].func ~= nil then
		--[[
		mx, my = -1, -1
		local touches = love.touch.getTouches()
		for i, id in ipairs(touches) do
			local x, y = love.touch.getPosition(id)
			mx = x
			my = y
			
		end
		--]]
		if (t[i].button_down == true and (mx < 0 and my < 0)) or (love.system.getOS ~= 'Android' and t[i].button_down == true and love.mouse.isDown(1) == false) then
			t[i].func(t[i])
			t[i].button_down = false
		end
	end

	if (mx > x_pos+padding and mx < x_pos+max_width-padding and my > y_pos+padding and my < max_height+y_pos-padding and
		((mx+x_pos >= 0 and my+y_pos >= 0 and mx-x_pos <= max_width and my-y_pos <= max_height))) == false then
		t[i].button_down = false
	end

	love.graphics.rectangle('fill', x_pos+padding, y_pos+padding, max_width-padding*2, max_height-padding*2, radius)

	if t[i].content ~= nil then
		lib.render(t[i].content, x_pos, y_pos, max_width, max_height)
	end
end